home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Arsenal - The Cutting Edge of Hacking / Hacker's Arsenal - The Cutting Edge of Hacking.iso / texts / nix / linux.txt < prev    next >
Encoding:
Text File  |  2001-07-11  |  32.1 KB  |  623 lines

  1. **Note: if this looks messed up in your browser, click the right mouse
  2. button and go to 'view source'. this will allow you to see this page in a
  3. text editor where it will look correct.**
  4.  
  5. The Beginners Guide To Linux v1.1
  6. Author: Squiler        
  7. Contact Squiler at: Just ICQ for now, UIN - 34500800, Nick - Squiler 
  8. http://blacksun.box.sk
  9. http://www.squiler.com
  10.  
  11.  ###########         #                   ###             #########      ##     # 
  12.  ############       ###                 #####           ###  #####     ###     ##
  13.  #####    ####     #####               #######         ###    ###     ####    ###
  14.  #####    #####   #######             #########       ###      #      ####  ####
  15.   ####   #####    #######            ###########     ###               ### ####
  16.    #########      #######           ####     ####    ###               #######  
  17.     ###########    #####           #####     #####    ###     ##      ####### 
  18.    #############    ###   ##      ######  #########    ###   ####     #########
  19.   ######     ####    #   ####      ########  #####      ##  ######     ###   ###
  20.  ######     ####     ##########     ####     ####        #########     ###  #####
  21.  #####     ####       ##########     ###     ###          #######     ####  ######
  22.  #############         ##########     ##     ##            #####      ####   ####
  23.  ###########            ########      ##     ##             ###        ###    ##
  24.  
  25.    #######       #     #        #     #
  26.   ##########    ##     ##      ##     ##            
  27.  ###    ###     ##     ##     ###     ###                                         
  28.   ###    #     ###     ###   #####    ####           Black Sun Research Facility  
  29.     ###         ##     ##    ######   ####             http://blacksun.box.sk     
  30.       ###       ##     ##    #######  ####                 ASCII By : cyRu5       
  31.    #   ###     ###     ###   ####  #######         
  32.   ###  ####   ####     ####   ###   #####               
  33.  ###########   ###########     ##    ###
  34.   #########      #######        #     #
  35.  
  36.  
  37.  
  38. 1.0 - Intro
  39.  
  40. Linux- sometimes referred to by the press as 'Windows NT's worst enemy'. 
  41. Wired Magazine once called it 'The greatest story never told'.  This is a
  42. perfect definition because the story behind Linux is indeed a great one, yet
  43. it is unknown to so many people.  Let's start at the beginning.
  44.  
  45. Back when 'Stayin' Alive' was still topping the charts, and Microsoft was
  46. a spec in the world of computers, AT&T produced a multi-user operating
  47. system and labeled it 'UNIX'.  Throughout the years, UNIX caught on and
  48. many different versions of it began to come out.  A popular one, called
  49. 'Minix' (mini-UNIX) was available for use at The University of Helsinki in
  50. Finland.  A student at the University named Linus Torvalds believed he
  51. could create an operating system superior to Minix.  In 1991 he started
  52. his new operating system as a side project, but it soon developed into a
  53. full-time hobby until 1994 when the first official version of the
  54. operating system was released.
  55.  
  56. You're probably now saying 'so what's the big deal about Linux? Isn't it
  57. just another operating system?' Absolutely not!  First of all, Linux is
  58. released under something called 'open source license'.  Open source is really
  59. more of an idea than a thing.  Linux is released with all the source code and
  60. files that it was made with.  This means a few things.  Anyone who is good
  61. at programming can mess with the Linux code and release his own version of
  62. it.  This also means that even though if you buy Linux in a store it will
  63. cost money, you're not paying for the actual Linux itself. Your money goes to
  64. the price of packaging, the extra software that comes with the operating
  65. system, and technical support.  The second, and most important reason that
  66. Linux is a big deal is because it's a much more stable operating system than
  67. Windows.  It runs on any system; even bottom of the line 386's from before
  68. Linux even came out.  Programs running under Linux almost never crash, and in
  69. the off chance that one does because of bad programming by the program author,
  70. it will not take the operating system down with it.  Another important reason
  71. Linux is good is that it is secure.  It is much harder to bring down by a
  72. hacker than Windows is (for further reading, read the 'Basic Unix Security
  73. Guide' by R a v e N at blacksun.box.sk).  This is just an extremely short list
  74. of the reasons why Linux is so great. For further reading check out
  75. www.linux.org
  76.  
  77. This tutorial is for Windows users who want to migrate to Linux.  This is
  78. written for Redhat or Mandrake Linux (the two most easy-to-install and
  79. user-friendly Linux distributions), but the information here will most probably
  80. help you with whatever distribution you are using. The only problem with this
  81. is that Mandrake and RedHat are relativley simple to install, and some other
  82. distrobutions are much more complex.  I highly suggest you buy Linux-Mandrake
  83. rather than RedHat.  Mainly because it is cheaper and comes with more
  84. software, but as you read through this tutorial, you'll see more reasons why I
  85. recommend Mandrake.
  86.  
  87. The first thing you're going to have to do with your new operating system is
  88. install it- but you can't do that so quickly.
  89.  
  90. 2.0 - Preparation
  91.  
  92. If you already have Microsoft Windows on your system and you want it to
  93. co-exist with Linux, you are going to have to create another hard drive
  94. partition.  What a hard drive partition is a totally separate part of a
  95. hard drive.  If two hard drive partitions weren't physically part of the
  96. same disc, they would be two different hard drives.  Anyway, the reason
  97. for this is that Windows and Linux are totally different in the way they
  98. access hard drives and handle files.  If they are using each other's hard
  99. drive space the two operating systems can conflict and cause major problems
  100. for your computer.  Well, as I was saying, you need to create a hard drive
  101. partition reserved for Linux.  There are MS-DOS programs that do this, but
  102. they are "lethal" partition making programs.  By this I mean that while making
  103. a new partition, they can destroy or at least corrupt files on another
  104. partition.  If you want to make a partition for Linux, without killing your
  105. Windows files you need a "non-lethal" partition program.  If you get
  106. Linux-Mandrake, a "non-lethal" partition program is included with it (this is
  107. just one of the reasons why I recommend Mandrake over RedHat).
  108.  
  109. Well with all this talk of partitions and hard drives, you must be wondering
  110. roughly how much hard drive space you'll need for Linux.  If you want the
  111. complete system with everything, you'll need about 1.5 gigabyte+ hard drive
  112. space.  However it is possible to productively run a full Linux distribution
  113. (there are "miniature" Linux distributions that range from around 2 to 35
  114. megabytes, and there's also Trinux, which runs from two 1.44MB floppy disks!
  115. Get it from www.trinux.org) to with as little as 150 megabytes. Trust me, you
  116. don't want EVERYTHING. Linux comes with tons of software you'll probably won't
  117. need. For example: Linux comes with a variety of network servers - a web
  118. server, a Sendmail server, a telnet server, an FTP server etc'.  If you choose
  119. not to install something and then regret, you can still get it later off the
  120. original installation CD.
  121.  
  122. So anyway, if you have sufficient hard drive space, and a "non-lethal"
  123. partition program, you're ready to proceed to the next step: installation.
  124.  
  125. ***Even if you're using a "non-lethal" partition program, I suggest you
  126. backup your Windows files just in case something goes wrong.***
  127.  
  128.  
  129. 3.0 - Installation
  130.  
  131. Now that your computer is ready for Linux, you're ready to install it.  
  132. When you bought the software, it probably came with a few CD's and a disk.
  133.  
  134. The disk is boot disk for the Linux installation program.  You pop in the
  135. disk, reset your computer, the installation program begins, and you're
  136. ready to install Linux.  The only thing is that the installation program
  137. will take a while to load since it's from a disk.
  138.  
  139. **The stuff on the disk is probably just a duplicate of some of the stuff
  140. on the first CD.  If your computer is capable of booting from a CD (and
  141. most newer ones are, otherwise, check your manual) then instead of putting
  142. the disk in your computer then rebooting, put in the first CD as it will
  143. load much quicker.  Of course, you'll need to mess with your BIOS
  144. configurations first, but that's no big deal.  Hit del when your computer
  145. boots up (after it tells you how much RAM you have) and mess around with it
  146. until you can find out how to make your computer attempt to boot from your CD
  147. drive first.  This differs from different BIOS systems.**
  148.  
  149. 3.1 - Ok..You're finally ready to install Linux.
  150.  
  151. The first few questions the install program asks you are self explanatory,
  152. just things like your language and stuff.  One thing you might get stumped
  153. on is when you are prompted on whether you have any SCSI adapters or not.  
  154. An SCSI adapter can be anything such as a mouse, printer, scanner, etc.  It
  155. all depends if you have an SCSI controller.  Chances are, you don't have any
  156. SCSIs, but check your manual to be sure.   Also, if you are completely sure
  157. that your copy of Microsoft Windows is properly-configured, you can quit the
  158. installation program at any time, return to Windows, run control panel, click
  159. on system and find out all the information you'll need about your system's
  160. hardware.
  161.  
  162. 3.2 - More Partition Stuff
  163.  
  164. The next thing you might have trouble with is a dialog box that appears
  165. asking you some questions about your hard drive partitions.  The name of
  166. the dialog box should 'Disk Setup'. There should be three buttons on the
  167. bottom of the box.  One labeled 'Disk Druid', another labeled 'fdisk', and
  168. the last is the back button.  Since you already set up your partitions,
  169. select 'Disk Druid'.  If you originally only had one partition with
  170. windows, then the top of the screen should look something like this:
  171.  
  172. Mount Point        Device       Requested       Actual              Type
  173.                    hda1         ??MB            ??MB           Win95
  174.                    hda2         ??MB            ??MB           Linux Swap
  175.                    hda3         ??MB            ??MB           Linux Native
  176.  
  177.  
  178. Mount point should be blank.
  179. 'Device' is the name of the partition
  180. 'Requested' is the amount of hard drive space you wanted for the partition
  181. 'Actual' is the amount of hard drive space that is really in the partition
  182. 'Type' is what's in the partition
  183.  
  184.  
  185. **The 'requested' and 'actual' sections for the 'Linux Swap" type should
  186. be the amount of RAM you have.**
  187.  
  188. **It looks confusing, but in reality if it is simple.  Don't worry if your
  189. screen doesn't look exactly like my diagram, it probably won't.**
  190.  
  191. What you should do now is select the 'Linux Native' section (by pressing
  192. tab to get to that part of the screen, then using the arrow keys) and then
  193. press tab again until the 'edit' button is highlighted.  Pressing spacebar
  194. will bring up another dialog box.  In the space provided, put a slash (/)
  195. then press OK.  Now you're back at the main screen. Press tab to get to
  196. OK, and then press spacebar.
  197.  
  198. **what you're actually doing here is telling the computer to put the root
  199. directory, signified by the slash, in the Linux Native partition.  The
  200. root directory '/', is similar to 'C:\' in DOS/Windows.**
  201.  
  202. Next you come to a screen asking which partitions to format.  Select the
  203. one that 'Linux Native' is in.  You should select the '/dev/xxxx/'
  204. partition where 'xxxx' is the name of the device that the Linux Native
  205. partition is under.  This is where you put the '/' on the last screen. If
  206. the Linux Native partition device was hda3 then choose '/dev/hda3', if it
  207. was hda6, then choose '/dev/hda6', you get the point.
  208.  
  209. **IT IS VERY IMPORTANT THAT YOU DO NOT SELECT THE WRONG PARTITION TO
  210. FORMART!**
  211.  
  212.  
  213. 3.3 - Selecting What to Install
  214.  
  215. Suppose you had three hard drives on Windows - c:\, d:\ and e:\, and you
  216. want to install Linux on d:\. Windows assigns the letter c to the first
  217. hard drive it finds that has a DOS/Windows file partition, d to the second
  218. DOS/Windows-compatible hard drive etc', so this might help you out
  219. determining which device to choose. Also, if you turn d:\ into the Linux
  220. hard drive, it will disappear from DOS/Windows, and e:\ will turn into
  221. d:\.
  222.  
  223. You're not finished yet, but take a sigh of relief, the hardest part is
  224. over.  Next comes the screen asking which packages to install.  Some of
  225. the most important ones are selected already.  If you have a lot of hard
  226. drive space, select all the other packages.  Otherwise, just select the
  227. others that you think are important.  Definitely select 'KDE' and 'GNOME'.
  228. Those are window manager programs for the X-Windows system (a GUI - Graphical
  229. User Interface), and we'll deal with them later.  Anyway, newer versions always
  230. come with new software and/or updates for old software.
  231.  
  232. Press OK and the Linux installation begins!
  233.  
  234. 3.4 - Misc. Configurations
  235.  
  236. After everything has been installed, you are prompted for more things.  
  237. The first should be what resolution your monitor is.  Most people would
  238. like to use the same resolution they use on Windows, so if you don't know
  239. which resolution you were using until now, switch back to Windows,
  240. right-click on your desktop area, click properties and find the settings
  241. tab. You should see your current resolution there. This would probably be
  242. the same resolution you would want to use on Windows. If you want a higher
  243. resolution, consult your monitor's manual to find out how high you can go.
  244.  
  245. Next is the mouse configuration.  If your mouse is not on the list, select
  246. 'Generic PS/2 Mouse'.
  247.  
  248. There are more such as clock set and time zone but those are
  249. self-explanatory.  After this, comes the services screen.  These are the
  250. things that will startup when you run Linux.  Then it will prompt you for
  251. if you want the X-Windows interface to run when you start Linux.  If you are a
  252. Linux newbie (and you probably are, unless you weren't reading this guide), I
  253. suggest you do this.  X windows is the GUI system, as explained before.
  254.  
  255. The last configuration is the printer.  This is self-explanatory.
  256.  
  257.  
  258. 3.5 - Configuring Users
  259.  
  260. Ok...you're almost done; the configurations are pretty much finished.  Now
  261. you will be prompted to create a password for the root operator. Even though
  262. it is still very popular on single home users, Linux is a multi-user operating
  263. system.  Even if you'll be the only person using your computer, having a
  264. multi-user system is quite benefical. For example: you can use a
  265. less-privileged user to prevent yourself from doing stupid things and messing
  266. things up.  You can run sensitive software which can be broken to (say, some
  267. sort of a server. For example: a Sendmail server for outgoing mail if you're
  268. planning to let people sent mail from your machine, or a web server if you
  269. want to serve a website off your computer) as a less-privileged user, so if
  270. someone will manage to exploit some hole in this software, he will have very
  271. limited privileges (up to what the program needs to run properly) and he won't
  272. be able to do much, or nothing at all in most cases (he won't have read
  273. access to password files, he won't have write access to the website's files
  274. so he won't be able to alter them etc').  On any UNIX-based system (and there
  275. are many) the main user is called 'root'.  The root has supreme power over the
  276. system and supreme power over all the other users.  In fact, he has unlimited
  277. power (unless he or another root-privileged user chooses to impose access
  278. limits, but root-privileged users can always restore their rights to the
  279. fullest).
  280.  
  281. My root password is a particularly simple one.  Mainly because I am the
  282. only one who uses Linux on my computer (and besides that I trust my own
  283. family!) and that my Linux system is not connected to the Internet (so
  284. hackers [or crackers I should say] would have no way to get into my
  285. system).  Make your password anything not to complicated that you'll
  286. forget it, but something that is very hard to guess.
  287.  
  288. After you're done making a password for the root user, you're prompted to
  289. create an unprivileged, or ordinary user account.  You make the user name,
  290. credentials, and password.  It may seem pointless at first to create
  291. another user- especially an unprivileged one if you are the only one who
  292. is going to be using Linux.  However there is a big advantage to it.  As a
  293. root user, you can do anything to the system, including seriously messing
  294. it up.  Nothing will stop you because you are root.  An ordinary user
  295. account is like security so if you mess up, the system will stop you.
  296.  
  297. 3.6 - Booting Configurations
  298.  
  299. Next you are asked if you want to create a boot disk.  I strongly recommend
  300. this because it will put the Linux boot stuff on the disk, not your computer. 
  301. If you put the Linux boot stuff on a computer with windows, it may conflict
  302. with the windows boot stuff in case you ever reinstall Windows (go to
  303. blacksun.box.sk/byteme.html and read #18 for a good example).
  304.  
  305. The Linux 'boot stuff' I'm talking about is a program called 'LILO'.  
  306. That's short for 'Linux Loader'.  Anyway LILO installs itself to the boot
  307. sector of the computer.  The problem is that Windows also installs stuff
  308. to the boot sector.  LILO can install over Windows and let you choose to
  309. either boot up Linux or Windows whenever you start up your computer.  If you
  310. choose Windows, it'll use Windows' "boot stuff".
  311.  
  312. Anyway, in my opinion, when the install program asks you to create a boot
  313. disk, click Ok, then follow the directions to create a boot disk.  Oh yeah,
  314. by the way, when you make a boot disk, it puts LILO on that disk.  When it
  315. asks you to install LILO, just press Skip (unless you want to install
  316. LILO, which most users will).
  317.  
  318. Congratulations! You're done installing Linux!  When the installation
  319. program ends, take the installation boot disk out of the drive.  If you
  320. booted the installation from CD, don't forget to take that out too.
  321.  
  322.  
  323. 4.0 - Running Linux
  324.  
  325. I bet you're glad to finish that installation!  Now you're finally ready
  326. to run the system. If you decided to create a boot disk, insert that into
  327. the disk drive.  If you decided to install LILO, just sit tight for now.  
  328. Regardless of what you did, reset your computer.  If you used LILO, you
  329. will get a prompt to load Linux or Windows.  If you used a boot disk, the
  330. system will startup automatically.
  331.  
  332. After the system starts up, the will get prompted for a user name and
  333. password.  This will look different depending on how you configured it in
  334. the installation.  If you chose to start the X Windows GUI automatically,
  335. the username and password screen will look like it does in Windows (well,
  336. sort of. X-Windows is much cooler, unless you're using some lame version of
  337. it or some lame window manager).  If you chose not to load the X Windows
  338. interface at startup (like most advanced users will), you'll be presented
  339. with a text-based interface.  The text-based interface (the command console)
  340. is much faster than the graphical system, but this also means you cannot view
  341. any graphics until you start X-Windows (this is a good time to mention that
  342. most people just call it X).  Anyway, you can always run a command console
  343. from an X window (usually called an "XTerm", which stands for X Terminal). 
  344. Anyway, the login screen will look pretty much the same regardless of
  345. whether you are using RedHat or Mandrake.
  346.  
  347. If you're wondering what to type in the username box, that's easy.  Your
  348. username is 'root' (remember?).  The password is the one that you selected
  349. at installation.
  350.  
  351.  
  352. 5.0 - Using Linux
  353.  
  354. 5.1 - Intro To The Console
  355.  
  356. Even though you'll probably be able to do everything with ease using the X
  357. Windows GUI, there is still some stuff you should know.  First off, don't
  358. rely on a GUI for everything!  That is very important because you will
  359. learn a lot by using the console.  The console is more powerful and can do a
  360. lot of things you would REALLY like if you'll just grab a good basic Unix book
  361. and start learning.  After you do, you'll find yourself often opening an XTerm
  362. window to run some console commands which you cannot run from X.  If you
  363. selected to start the GUI interface when Linux loads up, there are still lots
  364. of ways to get to the console.
  365.  
  366. The console prompt should look somewhat like this (if you're logged in as root):
  367. [root@localhost.localdomian]#
  368.  
  369. The first part identifies who you are, and the '#' is the actual prompt.  
  370. Any almost and UNIX type system, the '#' means you are root.  On non-root bash
  371. consoles (BASH - Bourne Again Shell.  BASH is the most popular text-based
  372. shell.  Confused?  Don't worry, we'll get to that in a second) this will be
  373. replaced with a $.  Anyway, you can change the prompt, but we won't get into
  374. that now.
  375.  
  376. 5.11 - Shells
  377.  
  378. You use a shell everytime you're in the Linux console.  What a shell is,
  379. is the program that communicates between you and the Kernel (the kernel is
  380. the core of the system).  Let's think of it as an interpreter for for two
  381. people who are trying to have a meeting, except they don't speak the same
  382. language.  One speaks English and the speaks, oh let's say Hebrew (about half
  383. the members of Black Sun Research Facility (blacksun.box.sk if you don't
  384. know the URL yet. Also, if you havn't noticed, I'm a member of BSRF) are from
  385. Israel).  To communicate with each other they need a guy who speaks both
  386. English and Hebrew.  If the English guy wants to tell the Hebrew guy
  387. something, he tells it to the interpreter in English, and then the
  388. interpreter tells it to the other guy in Hebrew, and vice versa.  Well
  389. anyway, getting back to the subject, this is the case with Linux.  Your
  390. language is the Linux commands, and the Kernel speaks it's own very complex
  391. language.  When you want to talk to the Kernel, you tell shell in your
  392. language, and the shell tells it to the Kernel in it's language.  On any Linux
  393. system, there a few shells.  Some of them are:
  394.  
  395. ash
  396. bash
  397. bsh
  398. csh
  399. tcsh
  400. zsh
  401.  
  402. The most popular and powerful shell is 'bash' (borne again shell).  We
  403. won't go that much into shells, because you don't need to know that much
  404. about them just yet.
  405.  
  406.  
  407. 5.2 - Navigating The File System
  408.  
  409. The most important thing to know when using the console is how to navigate
  410. the file system without a graphical program.
  411.  
  412. The first thing to understand about this is that the bottom directory, the
  413. directory that everything else is a subdirectory of is '/'.  It's like
  414. 'C:\' in Windows.
  415.  
  416. Ok, you start at the console and as a default you're either in your home
  417. directory (every user has a home directory which contains his personal
  418. configurations files).  Now you want to navigate to another directory.  But
  419. wait, you don't know any other directories!  You'll a directory listing for
  420. this, right?  To do this type 'ls' at the prompt. 'ls' is the equivlant to
  421. 'dir' in MS-DOS, and stands for list.   You'll get a list of files and
  422. folders.  To make the list a bit more readable, try ls -Fla.  The -a shows
  423. files which start with a period (for example: .Xclients-default).  The -l
  424. displays file permissions and displays everything in neat columns.  The -F
  425. option adds a / after a directory and a * after an executable file.  I also
  426. suggest using ls -Fla --color to let the system color-code different files
  427. (may not be available on some systems).
  428.  
  429. Anyway, now that you what directories there are, you need to know how to
  430. get into them.  Luckily, you use the same command as you you use in
  431. MS-DOS, the 'cd' (change directory) command.  Let's say you're at the
  432. bottom directory, '/' and you want to get to '/root'.  You simply type
  433. 'cd root'.  There is no need to type 'cd /root', because you're already in
  434. '/'.  Now let's say you want to get to '/root/bin'.  This would be done by
  435. typing 'cd bin'.  There is no need to type 'cd /root/bin' (the "full path" of
  436. the directory), since you're already in '/root'.  Instead, you can use a
  437. "relative path", which is a path that is relative to the current directory
  438. you're in.  Type pwd to find out where you are (pwd stands for print working
  439. directory).
  440.  
  441. Now let's say you're in '/root/bin' and you want to get to '/usr'.  You would
  442. type 'cd /usr'.  This is to signify that the 'usr' directory is under '/', not
  443. '/root/bin', or even '/root'.  Got it? Ok, just one more thing.  If you're in
  444. a subdirectory, and you want to get to the top directory, just type 'cd ..'. 
  445. Let's say you're in '/root/bin', and you want to get to '/root'.  You could
  446. just type 'cd /root', but hey, '/root' is five characters!  If you want to
  447. save precious miliseconds, just type 'cd ..', since '/root' is the directory
  448. in which '/root/bin' is a subdirectory of.  So in other words, . is the
  449. current directory, .. is one directory above, ... is two directories above
  450. etc'.
  451.  
  452. 5.3 - Basic File and Directory Commands
  453.  
  454. There are lots of file and directory commands in Linux, but we'll start
  455. with directory commands because they're easier.  First off, you have
  456. 'mkdir'.  'mkdir' stands for make directory and the context is:
  457.  
  458. mkdir the_directory_you_want_to_make
  459.  
  460. Some rulse apply.  If you're '/', it will make the new directory under
  461. '/'.  If you're in '/usr', it will make the directory under '/usr'.  Of
  462. course though, if you're in '/' and you want to make a directory called
  463. 'stuff' under '/usr', you would simply type '/usr/stuff'.
  464.  
  465. The next command is the 'rm' command.  It works with files and direcotires
  466. and is used to delete some, it stands for 'remove'.  If you want to remove
  467. a file called 'this.gif', you would go to the directory where that file is
  468. and type 'rm this.gif'.  Or let's say again you're in '/' and 'this.gif'
  469. is in '/usr', you would type 'rm /usr/this.gif'.  It works the same way
  470. with a directory.
  471.  
  472. Next are the 'cp' and 'mv' commands.  They're both relativley simple, but
  473. we'll start with 'cp'.  'cp' stands for copy, and is used to copy a file
  474. from directory to another.  The context is:
  475.  
  476. cp /directory_where_it_is/filename /directory_where_you_want_to_copy_it
  477.  
  478. Of course if you're already in the directory where the file is, all you
  479. need to type is:
  480.  
  481. cp filename /directory_where_you_want_to_copy_it
  482.  
  483. 'mv' works the exact same way, except it moves the file instead of copying
  484. it.  This means it deletes in from the original directory and puts it in
  485. the new one.
  486.  
  487.  
  488. 5.4 - Finding and Viewing Commands
  489.  
  490. To find a file, oyu use the 'find' command.  It then followed by the
  491. directory where you want to start looking, then the '-name' arguement to
  492. say that you're searching for a filename.  Next you type the name of the
  493. file.  Let's say you're looking for the 'this.gif' in the '/usr'
  494. directory, the context would look like this:
  495.  
  496. find /usr -name this.gif
  497.  
  498. The find command doesn't stop at filenames, it can also search a file for
  499. a paticular string of text.  It has the same context as the find file
  500. command except you put quotes and asteriks around the string of text.  So
  501. if you wanted to search the '/usr' directory for a file containing the
  502. string 'hello', you would type
  503.  
  504. find /usr -name "*hello*"
  505.  
  506. Ok, once you find a file, you want to view it right?  Well, you could open
  507. the file with a text editor, but we haven't learned to use tetx editors
  508. yet, and anyway if the file you want to view is important you might
  509. accidently change it and save it using a text editor.  That's what the
  510. 'cat' command is for.  Let's say you want to view a file called
  511. 'stuff.txt' in '/root'.  You would navigate to the '/root' directory and
  512. type 'cat stuff.txt'.  Or from any directory, type 'cat /root/stuff.txt'
  513.  
  514. -= For more commands, buy a good basic Unix book =-
  515.  
  516. 5.5 - linuxconf
  517.  
  518. There are lots of commands in Linux for configuring everything to user
  519. passwords, networks, and the message that comes up when you start Linux.  With
  520. so many things to configure, luckily there is one program that does it all. 
  521. Just type 'linuxconf' at the command prompt, and you'll be brought to the
  522. Linux Configuration program.
  523.  
  524.  
  525. 5.6 - Mounting
  526.  
  527. 5.61 - Mounting Drives
  528.  
  529. In Linux, drives not only have to be physically mounted to the computer, but
  530. mounted in software too.  In the KDE and GNOME GUIs, you can easily mount a
  531. CD-ROM or disk drive by clicking on the 'CD-ROM' or 'Disk Drive' icons on the
  532. desktop.
  533.  
  534. 5.62 - How to mount
  535.  
  536. Remember earlier in this tutorial when we went over how a hard drive partition
  537. is almost like a separate hard drive?  Well, just like a separate drive,
  538. partitions also have to be mounted.  The main use in this is being able to
  539. mount Windows partition and access Windows files in Linux.  Obviously, Windows
  540. software will not run under Linux but there is still a use for accessing
  541. Windows files in Linux.
  542.  
  543. Let's say you can't use the internet in Linux.  You ISP only allows to
  544. dialup with software and they don't make it for Linux, you're not used to
  545. Linux yet so you don't want to use the net in it yet.  This is a down
  546. point, but it doesn't mean you can't download Linux files to use.  All you
  547. have to do is download the files in Windows and access them in Linux.
  548.  
  549. To mount a windows partition in Linux, yhe first thing you must do is
  550. create a directory in Linux where you will mount the windows partition to
  551. reside.  Go into file manager (it should be under utilities no matter what
  552. distribution you're using) and create a new directory under '/'.  Call
  553. anything, I suggest calling it 'windows'.  Now exit file manager and go
  554. into 'terminal' (should also be under utilities). Terminal will give you a
  555. command prompt just like MS-DOS.  This is what you would have to do
  556. everything from if there were no X Windows GUI.  The command to use is
  557. simply enough- 'mount'.  But don't type it just yet, you need to give the
  558. system more info.  The full command is
  559.  
  560. mount -t vfat /dev/xxxx /yyyyyyy (yes there is a space between 'xxxx' and '/')
  561.  
  562. Or mount -t vfat32 /dev/xxxx /yyyyyyy in case this is a FAT32 partition.
  563.  
  564. Where 'yyyyyyy' is the directory you just created, and 'xxxx' is the device
  565. name of the partition where Windows resides.  It is usually hda1 or something.
  566.  
  567. There, now just go into file manager and click on the directory you created
  568. and you will have all the files that are on your windows partition.
  569.  
  570. When you're done, don't forget to unmount the drive by typing:
  571.  
  572. umount /dev/xxxx /yyyyyyy 
  573.  
  574. Each time you want to access your windows files, just mount the partition
  575. (unless they're set for automount. Edit /etc/fstab, find the line that
  576. represents your Windows partition and look for a place with says noauto.  If
  577. you find the word noauto, change it into defaults.  If you don't, your
  578. Windows partition will probably get automounted whenever you boot-up Linux).  
  579. When you're done with them, just unmount the partition.
  580.  
  581.  
  582. 5.7 - Runlevels
  583.  
  584. While Windows is booting, have you ever pressed the F8 key?  Well, if you
  585. have, you're probably familiar with a screen that pops up giving you a
  586. list of ways you can load Windows.  There's safe mode, command prompt,
  587. step-by-step confirmation, etc.  Linux has something just like that, and
  588. they're called 'runlevels'.  There are six runlevels in all, and some are
  589. pretty much the same.  A runlevel is a list of commands to load-up as soon
  590. as you start up Linux (there's a mini-tutorial about runlevels at
  591. blacksun.box.sk/byteme.html).  Your default runlevel is probably 5.  If you
  592. configured the GUI to start up when you boot the system, and if your default
  593. runlevel is 5, then that is the runlevel configured to boot the GUI when it
  594. starts up...simple, right?
  595.  
  596. Well anyway, if you use linuxconf to change your default runlevel to 2 or
  597. 3 or something, then you change it so that the GUI won't start as soon as
  598. the system boots....all without touching the actual runlevel.  When you
  599. want to change it back, just use linuxconf to set the default runlevel
  600. back to 5.
  601.  
  602. Now let's say you only want to load it without the GUI coming up once.  
  603. Instead of having to change the configuration in linuxconf, and then
  604. changing it back, you can load Linux into another runlevel.  Suppose You
  605. want to load runlevel 2...not for any paticular reason, just because it's
  606. not configured to load the GUI when it boots up, and well, you like the
  607. number 2.  To do this, as soon LILO comes up (whether it's on your
  608. computer, or your boot disk), you have the option to type something next
  609. to 'boot:'.  Just type 'linux x'.  'x' refers to the number of the
  610. runlevel, in this case the number 2, so you type 'linux 2', and press
  611. enter.  This will load Linux without loading the GUI.  When you restart
  612. Linux, it will load the default runlevel again.
  613.  
  614. For an interesting runlevels-related local hack, read the Byte-Me mini-tutorial
  615. about runlevels at blacksun.box.sk/byteme.html.
  616.  
  617.  
  618. You are now officially a Linux user.  Check out www.linuxlinks.com for
  619. links to some great Linux sites.  The best way to learn about Linux is by
  620. messing around with it.  In an hour of playing with Linux you can learn a
  621. lot.  If you want more interesting yet simple and easy-to-understand tutorials,
  622. check out http://blacksun.box.sk.
  623.